# 定义函数
def hello():
    print("jep python")


hello()


def max(a, b):
    if a > b:
        return a
    else:
        return b


print(max(10, 20))


# 传递不可变对象
def change(a):
    print("传入参数时", id(a))
    a = 20
    print("修改数值后", id(a))


a = 30
print("修改前:", id(a))
change(a)


def changeList(mylist):
    mylist.append([1, 2, 3])
    print("函数内取值:", mylist)
    return
# 调用函数值


mylist = [5, 4, 3]
print("函数调用前:",mylist)
changeList(mylist)
print("函数调用后:",mylist)


def modifyNum(name, age):
    print("age的值为", age)
    print("name的值为", name)
    return


modifyNum(age=10, name=20)


def definate(age , name="zhangsan"):
    print(name, end=" ")
    print(age, end=" ")
    return


definate(20,30)
definate("hhi",25)


def giveParam(var1, *var2):
    print(var1)
    print(var2)


giveParam(20, 30, 40, 50)
giveParam(20)


def printinfo(var1, **var2):
    print(var1)
    print(var2)



printinfo(30, d=20, e=30)
z = lambda arg1, arg2: arg1+arg2
print(z(10, 20))


def fun1(n):
    return lambda a: a*n


x = fun1(10)
y = fun1(11)
print(x(10))
print(y(10))


def printinfo(var1, var3):
    print(var1)
    print(var3)
# printinfo(12, x = 13, y = 30)

